package com.punch.order.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.punch.common.model.SuperEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author wjj
 * @since 2020-11-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("refund_order")
public class RefundOrder extends SuperEntity<RefundOrder> {

    private static final long serialVersionUID = 1L;

    /**
     * 退款类型 0-全额退款 1-教具退款
     */
    @TableField("refund_type")
    private Integer refundType;

    /**
     * 主订单id
     */
    @TableField("main_order_id")
    private Long mainOrderId;

    /**
     * 订单编号
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 微信订单号
     */
    @TableField("transaction_id")
    private String transactionId;

    /**
     * 微信退款单号
     */
    @TableField("refund_id")
    private String refundId;

    /**
     * 商户退款单号
     */
    @TableField("out_refund_no")
    private String outRefundNo;

    /**
     * 订单金额
     */
    @TableField("total_fee")
    private Integer totalFee;

    /**
     * 应结订单金额,
     * 当该订单有使用非充值券时，返回此字段。应结订单金额=订单金额-非充值代金券金额，应结订单金额<=订单金额
     */
    @TableField("settlement_total_fee")
    private Integer settlementTotalFee;

    /**
     * 申请退款金额
     */
    @TableField("refund_fee")
    private Integer refundFee;

    /**
     * 退款金额=申请退款金额-非充值代金券退款金额，退款金额<=申请退款金额
     */
    @TableField("settlement_refund_fee")
    private Integer settlementRefundFee;

    /**
     * 退款状态 退款状态 0-待退款 1-退款中 2-成功 3-异常 4-退款关闭
     * {@link com.punch.common.enums.order.RefundStatusEnum}
     */
    @TableField("refund_status")
    private Integer refundStatus;

    /**
     * 退款原因
     */
    @TableField("refund_desc")
    private String refundDesc;

    /**
     * 资金退款至用户帐号的时间
     */
    @TableField("success_time")
    private LocalDateTime successTime;

    /**
     * 退款入账账户
     */
    @TableField("refund_recv_accout")
    private String refundRecvAccout;

    /**
     * 退款资金来源
     */
    @TableField("refund_account")
    private String refundAccount;

    /**
     * API接口
     * 退款发起来源
     */
    @TableField("refund_request_source")
    private String refundRequestSource;


    @Override
    protected Serializable pkVal() {
        return null;
    }

}
